import React, { useEffect } from "react";
import { Modal, Form, Input, Select } from "antd";
import { useTranslation, Trans } from "react-i18next"; // 引入react-i18next

export default function WithdrawalModal(props) {
  const { open, hideModal, listData, form } = props; //  listData 接受父组件列表的数据
  const { t, i18n } = useTranslation(); // 结构拿出方法
  const content = listData.content;
  const { TextArea } = Input;

  useEffect(() => {
    form.setFieldsValue({
      accountBalance: content,
    });
  }, [listData]);

  return (
    <div>
      <Modal
        // title="全球付提现"
        title={t("buttons.Globalcashwithdrawal")}
        open={open}
        onOk={hideModal}
        onCancel={hideModal}
        // okText="确认"
        okText={t("buttons.confirm")}
        // cancelText="取消"
        cancelText={t("buttons.cancel")}
        width={600}
      >
        <Form
          form={form}
          labelCol={{ span: 6 }}
          wrapperCol={{ span: 14 }}
          layout="horizontal"
        >
          <Form.Item
            // label="账户余额"
            label={t("form.acountbalance")}
            name="accountBalance"
          >
            <Input />
          </Form.Item>
          <Form.Item
            label={t("form.withdrawalAmount")}
            // label="提现金额"
            name="withdrawalMoney"
          >
            <Input />
          </Form.Item>
          <Form.Item
            // label="提现账户"
            label={t("form.WithdrawalAccount")}
            name="withdrawalAmount"
          >
            <Select>
              <Select.Option value="demo">Demo</Select.Option>
            </Select>
          </Form.Item>
          <Form.Item
            label={t("form.LockingParty")}
            //  label="锁定方"
            name="lockedParty"
          >
            <Select>
              <Select.Option value="demo">Demo</Select.Option>
            </Select>
          </Form.Item>

          <Form.Item
            // label="交易密码"
            label={t("form.Transactionpassword")}
            name="password"
          >
            <Input.Password />
          </Form.Item>
          <Form.Item
            // label="备注"
            label={t("form.Remarks")}
            name="remarks"
          >
            <TextArea rows={2} />
          </Form.Item>
        </Form>
      </Modal>
    </div>
  );
}
